package com.etc.controller;

import com.etc.entity.Bookstype;
import com.etc.entity.Orders;
import com.etc.service.BooksTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/BooksTypeController")
@Api(tags = "图书类型管理相关接口")
@CrossOrigin
public class BooksTypeController {

    @Autowired
    BooksTypeService service;


    @GetMapping("/queryAllBooksType")
    @ApiOperation("全图书类型")
    public Map<String,Object> queryAllBooksType(){
        List<Bookstype> list = service.selectAllType();
        HashMap<String, Object> map = new HashMap<>();
        map.put("list",list);
        return map;
    }

}
